package com.buddy.learn.javasource._net;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author Buddy
 * @date 2021/5/19
 */
public class _InternetAddress {

    public static void main(String[] args) {
        try {
            InetAddress inetAddress1 = InetAddress.getByName("127.0.0.1");
            System.out.println(inetAddress1);
            InetAddress inetAddress4 = InetAddress.getLocalHost( );
            System.out.println(inetAddress4);

            InetAddress inetAddress2 = InetAddress.getByName("www.baidu.com");
            System.out.println(inetAddress2);


            InetAddress inetAddress3 = InetAddress.getByName("www.boyunvision.com");
            System.out.println(inetAddress3);


        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
    }
}
